package com.woorigil.social.domain.landing;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.woorigil.social.domain.CouponSqlMapDaoSupport;

@Repository
public class LandingDao extends CouponSqlMapDaoSupport<Landing, Integer> {
	public static final String NAMESPACE = "Landing";

	@Override
	public String getNamespace() {
		return NAMESPACE;
	}

	public int selectUserCount(LandingCondition condition) {
		return (Integer) getSqlMapClientTemplate().queryForObject(getStatementName(NAMESPACE, "selectUserCount"), condition);
	}
	
	public int selectLandingCount(LandingCondition condition) {
		return (Integer) getSqlMapClientTemplate().queryForObject(getStatementName(NAMESPACE, "selectLandingCount"), condition);
	}
	
	@SuppressWarnings("unchecked")
	public List<Landing> search(LandingCondition condition) {
		return getSqlMapClientTemplate().queryForList(getStatementName(NAMESPACE, "search"), condition);
	}
	
	@SuppressWarnings("unchecked")
	public List<Landing> selectList(){
		return getSqlMapClientTemplate().queryForList("Landing.selectList"); 
	}
}